// void, Obj me, Obj u

Unit this;
Obj target;

this = me.AsUnit();

while (.IsAlive()) {

	if (!.IsValidTarget(u)) break;
	if (!.InRange(u)) break;
	if(.DistTo(u) < .min_range) break;
	//.Attack(u);
	if(.Attack(u)){
		//######### MODUL GUARDIAN 1 START ###########
		if(u.AsUnit.IsHeirOf("EGuardian")){
			if(u.AsUnit.command != "engage" &&
			   u.AsUnit.command != "engage_unit_type"){
				if(rand(100) > 10){
					if(!u.AsUnit.BestTargetForPos.IsValid)
					if(u.AsUnit.health < u.AsUnit.maxhealth){
						u.AsUnit.Heal(500);
					}
				}
			}
		}
		//######### MODUL GUARDIAN 1 END ###########
	}
}

